<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
		<title>[:.Green Global - <?php echo $title_for_layout?>.:]</title>
		<?php 
		// header
		$params = array();
		if (isset($this->params['plugin'])) {
			$params['plugin'] = $this->params['plugin'];
		}
		
		// Load CSS
		echo $this->Html->css('general');
		echo $this->Html->css('cp.layout');
		echo $this->Html->css('vista_button');
		echo $this->Html->css('jquery.ui');
		
		// Load Javascript
		//echo $html->tag('javascript', '', array('src'=>'categories/js/abc.js'));
		echo $this->Html->script('jquery-1.3.2.min');
		echo $this->Html->script('ui.core');
		echo $this->Html->script('ui.draggable');
		echo $this->Html->script('ui.resizable');
		echo $this->Html->script('ui.dialog');
		echo $this->Html->script('jquery.form');
		?>
		<style>
		#firstpane_category li a {
			margin:0px;
		}
		.menu_body_category ul li a {
			margin:0px !important;
		}
		
	
div.menu_body_lv3 ul li {
	padding-left:30px !important;
	width:auto !important;
}
</style>
	<?php echo $this->element('backend_fix_ies')?>
	</head>
	<body>
	<?php $session->error();?>
	<?php 
	$login_permissions = $session->read('assigned_permissions');
	if (!is_array($login_permissions)) {
		$login_permissions = array();
	}
	?>
	<div id="changePassword" title="<?php __("Change Password")?>"></div>
	<script language="javascript">
	
	$(document).ready(function() {
		$("#changePassword").dialog({
			width: 400,
			resizable : false,
			autoOpen : false,
			modal	:	true
		});
		is_load_passform = false;
		$('a#change_user_password').click(function() {
			if (!is_load_passform) {
				var options = { 
				    //target:     '#changePassForm',
				    dataType : 'json',
				    success:    function(responseContent) { 
				        alert(responseContent.message);
				        $("#changePassword").dialog('close');
				    } 
				};
				$.ajax({
					type: 'GET',
					url : '<?php echo $html->url(array('plugin' => 'users', 'controller' => 'users', 'action' => 'change_pass'))?>',
					success : function(responseContent) {
						$('#changePassword').html(responseContent);
						$("#changePassword").dialog('open');
						$('#changePassForm').ajaxForm(options);
						is_load_passform = true;
					}
				});
			} else {
				$("#changePassword").dialog('open');
			}
		})
	});
	</script>
	<!-- Start Container -->
	<div id='container'>
		<!-- Start Header -->
		<div id='header'>
			<div class="top_header">
				<div class='flags'>
				<?php $langCode = Configure::read('Config.langCode');?>
				<?php echo $html->image('flags/' . $langCode . '_l.png');?>
				</div>
				<div class="logo">
				</div>
				<div class="info_proj">
					<div class="company_name"><?php __("Green Global CPanel")?></div>
					<div class="proj_name"><?php __("Back-end System")?></div> 	
				</div>
				<div class="right_height">
					<div class='logged'>
						<div class='accoun'>
							[<span> <?php echo $my_username?> </span>|
						</div>
						<div class='accoun white'>
							<a href='#' id='change_user_password'><?php __("Change Password")?></a> | 
							<a href='<?php echo $html->url('/logout')?>'><?php __("Logout")?> ]</a> 
						</div>
						
					</div>
					<div class="header_menu">
						<div class="l_header_mn">
						</div>
						<div class="center_header_mn">
							<ul>
								<li><a href="<?php echo $html->url('/')?>"><?php __("Homepage")?></a></li>
								<li class="line"></li>
								<li><a href="<?php echo $html->url(array('plugin' => 'users', 'controller' => 'manage_users', 'action' => 'index'))?>"><?php __("User Manager")?></a></li>
								<li class="line"></li>
								<li><a href="#<?php echo $html->url(array('plugin' => 'configurations', 'controller' => 'manage', 'action' => 'index'))?>"><?php __("Preferences")?></a></li>
							</ul>
						</div>
						<div class="r_header_mn">
						</div>
						<div class="clear"></div>
					</div>
				</div>
				<div class="clear"></div>
			</div>
			<!-- Start Menu -->
			<div class="container_topmenu">
				<?php //echo $this->element('languages')?>
				<div id="menu">
					<div class="bd_submn">
					</div>
					<?php echo $this->element('languages')?>
					
					<!-- Quản lý liên hệ - top menu : begin -->
					<?php echo $this->element('top_menu/contacts', array('permissions'	=>	$login_permissions))?>
					<!-- Quản lý liên hệ - top menu : end -->
					
					<div class="clear"></div>
				</div>
				<!-- End Menu -->
				<!-- Top Search -->
				<!--End Top Search -->
			</div>	
		</div>
		<!-- End Header -->
		<!-- Start Content -->
		<div id='content'>
			<div class="left_slidebar">
				<?php echo $this->element($this->left_menu, $params + array('permissions'	=>	$login_permissions))?>
			</div>
			<div class="container_right">
				<?php echo $content_for_layout;?>
			</div>
		<!-- End Content -->
		</div>
	</div>
	<div id='footer' class="footer_layouts">
		<div class="container_footer">
			<div class="copy_right">
			<?php __("Copyright @ 2009 System Information Management");?>
			</div>
			<div class="link_footer">
				<a target="blank" href="http://webdev.vn/">
				<?php echo $html->image('copy_right.png', array('border'=>0));?>
				</a>
			</div>
			<div class="clear">
			</div>
		</div>
	</div>
	<!-- End Container -->
	</body>
</html>
